# _*_ coding : utf-8 _*_
# @Time : 2023/8/27 17:08
# @Author : 寻梦
# @File : 04_requests_代理的使用
# @Project : code
import requests

url='https://www.baidu.com/s'

headers={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 SLBrowser/8.0.1.5162 SLBChan/30"
}

params={
    "wd":"北京"
}

proxy={
    "http":"127.0.0.1:8080"
}

response=requests.get(url=url,params=params,headers=headers,proxies=proxy)
response.encoding="utf8"
content=response.text
print(content)
print(response.url)